package com.gitee.chili.leisure.service;

import cn.hutool.json.JSONObject;
import com.gitee.chili.leisure.ResponseResult;
import com.gitee.chili.leisure.config.FeignDefaultConfiguration;
import com.gitee.chili.leisure.domain.*;
import com.gitee.chili.leisure.domain.dto.EntryRoomQuery;
import com.gitee.chili.leisure.domain.dto.LoginQuery;
import com.gitee.chili.leisure.domain.dto.MemberVo;
import com.gitee.chili.leisure.enums.CurrencyToken;
import com.gitee.chili.leisure.game.RoomDetail;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * feign 远程调用客户端
 *
 * @author week solider
 * @since 2020.09.01
 */
@FeignClient(name = "web-manager-service", configuration = FeignDefaultConfiguration.class)
public interface SpecificTaskTransferClient {

    @PostMapping("/member/login")
    ResponseResult<MemberVo> login(LoginQuery login);

    @PostMapping("/member/get")
    ResponseResult<Member> getMember(Long memberId);

    @PostMapping("/account/getAccountAll")
    ResponseResult<List<Account>> getAccountAll(Long userId, List<CurrencyToken> tokens);

    @PostMapping("/account/getAccount")
    ResponseResult<Account> getAccount(JSONObject param);

    @PostMapping("/gameType/getType")
    ResponseResult<GamesMode> getType(Long gameType);

    @PostMapping("/room/createFriendRoom")
    ResponseResult<RoomDetail> createRoom(Room room);

    @PostMapping("/room/entry")
    ResponseResult<EntryRoom> entryRoom(EntryRoomQuery query);

    @PostMapping("/room/leave")
    ResponseResult<EntryRoom> leaveRoom(Long roomNum, Long memberId);

    @PostMapping("/room/dissolved")
    ResponseResult<Room> dissolvedRoom(Long roomNum);
}
